package com.lsl.bhllserver.entity;

import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

@TableName("orders")
public class Order implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private Integer prodId;
    private Integer cusId;
    private Integer orderBuyCount;
    private String orderPostman;
    private Integer orderPostage;
    private Date orderDate;
    private Integer orderStatus;
    private Date orderFinishDate;

    public Order() {   
    }

    public Order(Integer id, Integer prodId, Integer cusId, Integer orderBuyCount, Integer orderPostage,
            String orderPostman, Date orderDate, Integer orderStatus, Date orderFinishDate) {
        this.id = id;
        this.prodId = prodId;
        this.cusId = cusId;
        this.orderBuyCount = orderBuyCount;
        this.orderPostage = orderPostage;
        this.orderPostman = orderPostman;
        this.orderDate = orderDate;
        this.orderStatus = orderStatus;
        this.orderFinishDate = orderFinishDate;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getProdId() {
        return prodId;
    }

    public void setProdId(Integer prodId) {
        this.prodId = prodId;
    }

    public Integer getCusId() {
        return cusId;
    }

    public void setCusId(Integer cusId) {
        this.cusId = cusId;
    }

    public Integer getOrderBuyCount() {
        return orderBuyCount;
    }

    public void setOrderBuyCount(Integer orderBuyCount) {
        this.orderBuyCount = orderBuyCount;
    }

    public Integer getOrderPostage() {
        return orderPostage;
    }

    public void setOrderPostage(Integer orderPostage) {
        this.orderPostage = orderPostage;
    }

    public String getOrderPostman() {
        return orderPostman;
    }

    public void setOrderPostman(String orderPostman) {
        this.orderPostman = orderPostman;
    }

    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }

    public Date getOrderFinishDate() {
        return orderFinishDate;
    }

    public void setOrderFinishDate(Date orderFinishDate) {
        this.orderFinishDate = orderFinishDate;
    }

    /*
     * 重写 hashCode() 和 equals() 方法用于让 HashSet 能够自动去重
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        result = prime * result + ((prodId == null) ? 0 : prodId.hashCode());
        result = prime * result + ((cusId == null) ? 0 : cusId.hashCode());
        result = prime * result + ((orderBuyCount == null) ? 0 : orderBuyCount.hashCode());
        result = prime * result + ((orderPostman == null) ? 0 : orderPostman.hashCode());
        result = prime * result + ((orderPostage == null) ? 0 : orderPostage.hashCode());
        result = prime * result + ((orderDate == null) ? 0 : orderDate.hashCode());
        result = prime * result + ((orderStatus == null) ? 0 : orderStatus.hashCode());
        result = prime * result + ((orderFinishDate == null) ? 0 : orderFinishDate.hashCode());
        return result;
    }

    /*
     * 重写 hashCode() 和 equals() 方法用于让 HashSet 能够自动去重
     */
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Order other = (Order) obj;
        if (id == null) {
            if (other.id != null)
                return false;
        } else if (!id.equals(other.id))
            return false;
        if (prodId == null) {
            if (other.prodId != null)
                return false;
        } else if (!prodId.equals(other.prodId))
            return false;
        if (cusId == null) {
            if (other.cusId != null)
                return false;
        } else if (!cusId.equals(other.cusId))
            return false;
        if (orderBuyCount == null) {
            if (other.orderBuyCount != null)
                return false;
        } else if (!orderBuyCount.equals(other.orderBuyCount))
            return false;
        if (orderPostman == null) {
            if (other.orderPostman != null)
                return false;
        } else if (!orderPostman.equals(other.orderPostman))
            return false;
        if (orderPostage == null) {
            if (other.orderPostage != null)
                return false;
        } else if (!orderPostage.equals(other.orderPostage))
            return false;
        if (orderDate == null) {
            if (other.orderDate != null)
                return false;
        } else if (!orderDate.equals(other.orderDate))
            return false;
        if (orderStatus == null) {
            if (other.orderStatus != null)
                return false;
        } else if (!orderStatus.equals(other.orderStatus))
            return false;
        if (orderFinishDate == null) {
            if (other.orderFinishDate != null)
                return false;
        } else if (!orderFinishDate.equals(other.orderFinishDate))
            return false;
        return true;
    }

    @Override
    public String toString() {
        return "Order [id=" + id + ", prodId=" + prodId + ", cusId=" + cusId + ", orderBuyCount=" + orderBuyCount
                + ", orderPostman=" + orderPostman + ", orderPostage=" + orderPostage + ", orderDate=" + orderDate
                + ", orderStatus=" + orderStatus + ", orderFinishDate=" + orderFinishDate + "]";
    }

}
